#!/usr/bin/env python2
#-*-encoding:utf8-*-

from isinside import *

def start_locate():
    """
    an example to use isInside method,return locate ids of points.
    such as {(118.833, 32.121): set(['160113004011'])}
    """
    with open('4g_nj.dat','r') as f:
        src_dict =  catch_data('result_rc.dat')
        i = 0
        for line in f:
            i = i+1
            if i >0:
                #print('%s' % line)
                cid = line.split('|')[0]
                coor = line.split('|')[2:4]
                ret = p_isinside(float(coor[0]),float(coor[1]),src_dict) 
                if ret:
                    print ret
    return 1



if __name__ == '__main__':
    start_locate()
